#include <iostream>

class Test
{
public:
    Test()
    {
        std::cout<<"构造函数"<<std::endl;
    }

    void show()
    {
        std::cout<<"helloworld"<<std::endl;
    }

    // Test Copy()
    
    ~Test()
    {
        std::cout<<"析构函数"<<std::endl;
    }
};
class SmartPoint
{
public:
    SmartPoint(Test *t)
    {
        this->t = t;
    }

    ~SmartPoint()
    {
        delete t;
    }

   Test* operator->()
   {
        return t;
   }

   Test& operator*()
   {
        return *t;
   }
private:
    Test *t;
};
int main()
{
    SmartPoint p(new Test); //内存托管
    p->show();
    Test obj = *p;
    return 0;
}